﻿using System;
using System.Data;
using AlertSystem.Dab.LK;

namespace AlertSystem.Dab.MoneyOperations
{
    public class MoneyLoadParser:ILoadParser<MoneyAlertItem>
    {
        public MoneyAlertItem ParceFrom(object item)
        {
            var dr = item as DataRow;
            if (dr == null || dr.GetType() != typeof(DataRow)) throw new ArgumentException("item");

            return new MoneyAlertItem(dr);
        }

        public Type GetAlertType()
        {
            return typeof(MoneyAlertItem);
        }
    }
}
